<?php

$files = array(
		"modules/XForms/Element/Control/Group.js",
		"modules/XForms/Element/Control/Label.js",
		"modules/XForms/Element/Control/Submit.js",
		"modules/XForms/Element/Control/Textarea.js",
		"modules/XForms/Element/Control/Input.js",
		"modules/XForms/Element/Control/Abstract.js",
		"modules/XForms/Element/Head/Bind.js",
		"modules/XForms/Element/Head/Submission.js",
		"modules/XForms/Element/Head/Instance.js",
		"modules/XForms/Element/Head/Model.js",
		"modules/XForms/Element/Head/Abstract.js",
		"modules/XForms/Element/Abstract.js",
		"modules/XForms/Binding.js",
		"modules/XForms.js",
		"factory/events.js",
		"factory/i18n.js",
		"factory/xslt.js",
		"factory/xml.js",
		"common/XPath.js",
		"common/Array.js",
		"common/QName.js",
		"dependencyGraph.js",
		"core.js"
);

// Get the path to your web directory
$docRoot = realpath('.');

// Merge code
$code = '';

while ($file = array_pop($files)) {
	$code .= file_get_contents("$docRoot/$file");
}

$filename = "concentre.js";	 

// Send HTTP headers
header("Cache-Control: must-revalidate");
header("Content-Type: text/javascript");
header('Content-Length: '.strlen($code));
header("Content-Disposition: inline; filename=$filename");	
   
// Output merged code
echo $code;

?>